﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ImportDB
{
    public partial class frmSetting : Form
    {

        List<System.Configuration.SettingsPropertyValue> settings;

        public frmSetting()
        {
            InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            Properties.Settings.Default.Save();
            Close();
        }

        private void frmSetting_Load(object sender, EventArgs e)
        {
            this.settings = GetSettingList();
            gvSettings.AutoGenerateColumns = false;
            gvSettings.DataSource = this.settings;
        }

        private List<System.Configuration.SettingsPropertyValue> GetSettingList()
        {
            
            List<System.Configuration.SettingsPropertyValue> list = new List<System.Configuration.SettingsPropertyValue>();
            string s = (string)Properties.Settings.Default.mysqldb;
            foreach (System.Configuration.SettingsPropertyValue item in Properties.Settings.Default.PropertyValues)
            {
                item.PropertyValue = item.PropertyValue;
                list.Add(item);
            }

            return list;
        }

        
    }
}
